import java.io.FileNotFoundException;

public class Main {
    //throws加在方法后面，声明这个方法可能抛出的异常
    private static void openConfig(String filename) throws FileNotFoundException{
        if(!filename.equals("config.txt")){
            throw new FileNotFoundException("文件不存在");
        }
    }

    public static void main(String[] args) throws FileNotFoundException {
        openConfig("xxx");
    }
}
